package com.wonders.hs.pd.mm.web.utils;

import org.springframework.context.ApplicationContext;

/**
 * @author banglong
 * @date 2016/9/8.
 */
public class ApplicationContextUtil {

  private static volatile ApplicationContext applicationContext;

  public static void setApplicationContext(ApplicationContext context) {

    if (applicationContext == null) {
      synchronized (ApplicationContextUtil.class) {
        if (applicationContext == null) {
          applicationContext = context;
        }
      }
    }
  }

  static ApplicationContext getApplicationContext() {
    return applicationContext;
  }
}
